package com.scrumtrek.trainings.tdd;

/**
 * Created with IntelliJ IDEA.
 * User: zeliboba
 * Date: 11.09.13
 * Time: 10:21
 * To change this template use File | Settings | File Templates.
 */
public class Book extends Item{
    private String title;
    private String author;
    private String publisher;
    private String year;

    public Book(String title, String author, String publisher, String year) {
        this.author = author;
        this.title = title;
        this.publisher = publisher;
        this.year = year;
    }

    public Book(String title) {
        this.title = title;
    }

    public Book(String title, String author) {
        this.author = author;
        this.title = title;
    }

    public Book(String title, String author, String publisher) {
        this.author = author;
        this.title = title;
        this.publisher = publisher;
    }

    public Book(String title, int price){
        this.price = price;
        this.title = title;
    }

    public String getYear() {
        return year;
    }

    public String getTitle() {
        String value = title;
        if (publisher != null) {
            value += "[" + publisher + "]";
        }
        if (year != null) {
            value += "[" + year + "]";
        }
        return value;
    }

    public String getAuthor() {
        return author;
    }
}
